package com.lrs.java.j2se_self.lastJava;
import java.io.*;
import java.util.*;
public class TestPrintStream2 {
	public static void main(String[] args){
		try{
			FileWriter f = new FileWriter("c:/test.log");
			PrintWriter pw = new PrintWriter(f);
			InputStreamReader i = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(i);
			String s = null;
			while((s=br.readLine())!=null){
				if(s.equalsIgnoreCase("exit"))break;
				pw.println("----");
				pw.println(s);
				pw.flush();
				
			}
			pw.println("===="+new Date()+"====");
			pw.close();
		}catch(IOException e){
			e.printStackTrace();
		}
		
	}
}
